<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${props['mapperPackage']}.${tableClass.shortClassName}Mapper">
    <resultMap id="BaseResultMap" type="${tableClass.fullClassName}">
        <#if tableClass.pkFields??>
            <#list tableClass.pkFields as field>
                <id column="${field.columnName}" jdbcType="${field.jdbcType}" property="${field.fieldName}"/>
            </#list>
        </#if>
        <#if tableClass.baseFields??>
            <#list tableClass.baseFields as field>
                <result column="${field.columnName}" jdbcType="${field.jdbcType}" property="${field.fieldName}"/>
            </#list>
        </#if>
    </resultMap>

    <sql id="Base_Column_List">
        <#list tableClass.baseFields as field>
            <#if field_index != tableClass.baseFields?size - 1 >
                ${field.columnName},
            <#else>
                ${field.columnName}
            </#if>
        </#list>
    </sql>

</mapper>
